﻿<%@ WebHandler Language="C#" Class="inforoom" %>

using System;
using System.Web;
using System.Data;
using System.Text;
using DTO;
using BLL;

public class inforoom : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        string strXML = "";
        try{
            string idRoom = context.Request.QueryString["r"];
            Rec_Room phong = new Rec_Room();

            DataTable tbl = null;
                //phong.GetDataTable(12, Convert.ToInt64(idRoom)); 
            if (tbl != null && tbl.Rows.Count>0){
                strXML = tbl.Rows[0]["MaPDP"].ToString() + ";" + tbl.Rows[0]["NgayDen"].ToString() + ";" + tbl.Rows[0]["NgayDi"].ToString() + ";" + tbl.Rows[0]["TenKhachHang"].ToString() + ";" + tbl.Rows[0]["TenLoaiKhachHang"].ToString() + ";" + string.Format("{0: #,0.##}", Convert.ToDouble(tbl.Rows[0]["Minibar"])) + ";" + string.Format("{0: #,0.##}", Convert.ToDouble(tbl.Rows[0]["GiatLa"])) + ";" + string.Format("{0: #,0.##}", Convert.ToDouble(tbl.Rows[0]["DienThoai"])) + ";" + string.Format("{0: #,0.##}", Convert.ToDouble(tbl.Rows[0]["DonGiaNgay"]));
            }
        }
        catch { strXML = string.Empty; }
        context.Response.ContentType = "text/plain";
        context.Response.Write(strXML.ToString());
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}